<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta name="author" content="lzb(334758) | 2017-11-01">
    <meta name="editor" content="lzb(334758) | 2017-11-01">
    <link rel="shortcut icon" type="image/x-icon" href=""/>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
    <title>
    <?php 
    if (is_home()) {
        bloginfo('name');
    } else if (is_single() || is_page()) {
        the_title();
        echo ' - ';
        bloginfo('name');
    } else if (is_search()) {
        echo '搜索结果 - ';
        bloginfo('name');
    } else {
		wp_title('',true);
	}
    ?></title>
    <?php wp_head(); ?>
</head>
<body>
    <div class="page-wrap">
    <!-- 头部 -->
    <div class="header">
        <div class="wrap clearfix">
            <h1 class="logo">
                <a href="/"><img src="<?php bloginfo('template_url'); ?>/img/logo.png" alt=""></a>
            </h1>
            <div class="search clearfix">
                <form class="clearfix" role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
                    <div class="search-input">
                        <input type="text" name="s" id="s" value="<?php the_search_query(); ?>" placeholder="请输入您要搜索的内容">
                    </div>
                    <div class="search-submit">
                        <input id="searchsubmit" type="submit" value="">
                    </div>
                    <div class="search-lang">
                        <a id="translateID" href="javascript:;">繁</a>
                    </div>
                </form>
            </div>
            <div class="calendar">
                <p>
                    <span>公立</span><?php the_time('Y-m-d l') ?></p>
                <p>
                    <span>农历</span><span id="lunar-today"></span></p>
                <p>
                    <span>佛历</span>
                    <?php
                        $year = date('Y');
                        $month = date('m');
                        $date = date('d');
                        $buddhismYear = $year + 623;
                        //佛历是今年年份+623。如果现在时间是7月30日及以后，佛历年份+1；
                        if ($month > 7 || ($month === 7 && $date >= 30)) {
                            $buddhismYear += 1;
                        }
                        echo $buddhismYear;
                    ?>
                    年
                </p>
            </div>
            <div class="code">
                <img src="<?php bloginfo('template_url'); ?>/img/pic-code.jpg" alt="">
                <a href="javascript:;"></a>
            </div>
        </div>
    </div>
<?php ?>
    

    <!-- 导航 -->
    <div class="nav">
        <div class="wrap">
            <!-- <ul class="menu clearfix">
                <li <?php if (is_home()) { echo 'class="current"';} ?>>
                    <a href="/">首页</a>
                </li>
                <li <?php if (array_slice(explode('/', get_the_permalink($post)), -1)[0] === 'news' && is_page()) { echo 'class="current"';}  ?>>
                    <a href="/news">新闻聚焦</a>
                </li>
                <li <?php if (array_slice(explode('/', get_the_permalink($post)), -1)[0] === 'topic' && is_page()) { echo 'class="current"';}  ?>>
                    <a href="/topic">专题</a>
                </li>
                <li <?php if (array_slice(explode('/', get_the_permalink($post)), -2)[0] === 'about' && is_page()) { echo 'class="current"';}  ?>>
                    <a href="/about/index">本会简介</a>
                </li>
                <li <?php if (array_slice(explode('/', get_the_permalink($post)), -1)[0] === 'buddhism-news' && is_page()) { echo 'class="current"';}  ?>>
                    <a href="/buddhism-news">佛讯动态</a>
                </li>
                <li <?php if (array_slice(explode('/', get_the_permalink($post)), -1)[0] === 'video' && is_page()) { echo 'class="current"';}  ?>>
                    <a href="/video">视频</a>
                </li>
                <li <?php if (array_slice(explode('/', get_the_permalink($post)), -2)[0] === 'fj-temple' && is_page()) { echo 'class="current"';}  ?>>
                    <a href="/fj-temple/fuzhou-temple">福建寺院</a>
                </li>
                <li <?php if (array_slice(explode('/', get_the_permalink($post)), -1)[0] === 'welfare' && is_page()) { echo 'class="current"';}  ?>>
                    <a href="/welfare">慈善公益</a>
                </li>
                <li <?php if (array_slice(explode('/', get_the_permalink($post)), -1)[0] === 'education' && is_page()) { echo 'class="current"';}  ?>>
                    <a href="/education">文化教育</a>
                </li>
                <li <?php if ((array_slice(explode('/', get_the_permalink($post)), -1)[0] === 'issue' || array_slice(explode('/', get_the_permalink($post)), -1)[0] === 'briefing') && is_page()) { echo 'class="current"';}  ?>>
                    <a href="/issue">期刊简报</a>
                    <span></span>
                    <ul>
                        <li>
                            <a href="/issue" title="">期刊</a>
                        </li>
                        <li>
                            <a href="/briefing" title="">简报</a>
                        </li>
                    </ul>
                </li>
                <li <?php if ((array_slice(explode('/', get_the_permalink($post)), -1)[0] === 'message' || array_slice(explode('/', get_the_permalink($post)), -1)[0] === 'download') && is_page()) { echo 'class="current"';}  ?>>
                    <a href="/message">在线服务</a>
                    <span></span>
                    <ul>
                        <li>
                            <a href="/message" title="">在线留言</a>
                        </li>
                        <li>
                            <a href="/download" title="">下载专区</a>
                        </li>
                    </ul>
                </li>
            </ul> -->
            <ul class="menu clearfix">
            <?php
				wp_nav_menu( array(
					'menu' => 'fomenu',
					// 'theme_location' => 'menu-1',
					'menu_id'        => 'primary-menu',
				) );
			?>
            </ul>
        </div>
    </div>